<template>
    <el-row>
        <el-col :span="24">
            <el-table :data="List" border stripe height="700">
                <el-table-column type="index" align="center"></el-table-column>
                <el-table-column label="模板名称" prop="modelName" align="center">
                </el-table-column>
                <el-table-column label="操作" align="center">
                    <template slot-scope="scope">
                        <el-button type="primary" @click="downLoadExcelModel" size="small">下载</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-col>
    </el-row>
</template>

<script>
    import * as api from "@/api"
    export default {
        data() {
            return {
                List: []
            }
        },
        methods:{
            async initData(){
                let res = await api.getExcelModelList();
                // 这里你返回的数据按理来说应该是键值对的形式。。。
                res.modlelist.forEach(element => {
                    this.List.push({
                        modelName:element
                    })
                });;
            },
            async downLoadExcelModel(){
                let res = await api.ExcelDownload();
                alert(JSON.stringify(res))
            }
        },
        async mounted(){
           
        }
    }
</script>


<style scoped>
</style>